/*
 * list.h
 *
 *  Created on: 2011-8-24
 *      Author: jfhu
 */

#ifndef LIST_H_
#define LIST_H_

#include <stdio.h>

typedef struct _listnode {
	int value;
	struct _listnode* next;
} listnode, *pListnode;

typedef struct _list {
	pListnode head;
	pListnode tail;
} list, *pList;

/* Initialize the listnode */
void initializelistnode(pListnode n);

/* Initialize the list */
void initializelist(pList l);

/* Append a listnode to a list */
void append(pListnode n, pList l);

/* Pop up the first listnode on a list */
pListnode popList(pList l);

/* Printf the list */
void printfList(pList l);

#endif /* LIST_H_ */
